let mongoose = require("./db");
const { Schema } = require("mongoose");

const navigationSchema = new Schema({
  name: String,
  status: {
    type: Boolean,
    default: false,
  },
});

const sideSchema = new Schema({
  name: String,
  router: {
    type: String,
    default: "",
  },
  navigation: String,
  status: {
    type: Boolean,
    default: false,
  },
  sid: {
    type: mongoose.Types.ObjectId,
    ref: "side",
  },
  icon: {
    type: String,
    default: "",
  },
  level: Number,
});

const navigationModel = mongoose.model(
  "navigation",
  navigationSchema,
  "navigation"
);
const sideModel = mongoose.model("side", sideSchema, "side");

module.exports = {
  navigationModel,
  sideModel,
};
